package com.worldcup.model.dto;

import com.worldcup.model.Game;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author duwan.zq
 * @date 2018/05/29
 */
@Getter
@Setter
public class GameDTO implements Serializable{

    private Integer id;

    private String time;

    private String city;

    private String court;

    private String homeTeam;

    private Integer homeScore;

    private String homeTeamImg;

    private String awayTeam;

    private Integer awayScore;

    private String awayTeamImg;

    private String type;

    public GameDTO(Game game) {
        this.id = game.getId();
        this.time = game.getTime();
        this.city = game.getCity();
        this.court = game.getCourt();
        this.homeTeam = game.getHomeTeam();
        this.homeScore = game.getHomeScore();
        this.awayTeam = game.getAwayTeam();
        this.awayScore = game.getAwayScore();
        this.type = game.getType();
    }

    public GameDTO(Game game, String homeTeamImgUrl, String awayTeamImgUrl) {
        this.id = game.getId();
        this.time = game.getTime();
        this.city = game.getCity();
        this.court = game.getCourt();
        this.homeTeam = game.getHomeTeam();
        this.homeScore = game.getHomeScore();
        this.awayTeam = game.getAwayTeam();
        this.awayScore = game.getAwayScore();
        this.type = game.getType();
        this.homeTeamImg = homeTeamImgUrl;
        this.awayTeamImg = awayTeamImgUrl;
    }

    @Override
    public String toString() {
        return "GameDTO{" +
            "id=" + id +
            ", time='" + time + '\'' +
            ", city='" + city + '\'' +
            ", court='" + court + '\'' +
            ", homeTeam='" + homeTeam + '\'' +
            ", homeTeamImg='" + homeTeamImg + '\'' +
            ", awayTeam='" + awayTeam + '\'' +
            ", awayTeamImg='" + awayTeamImg + '\'' +
            ", type='" + type + '\'' +
            '}';
    }
}
